const path = require('path')
//const packageName = 'child-web1';
const name = require('./package.json').name;

function resolve (dir) {
	return path.join(__dirname, dir)
}

module.exports = {
	publicPath: '/' + name,
	pages: {
		index: {
			entry: 'src/main.js',
			template: 'public/index.html',
			filename: 'index.html'
		},
		user: {
			entry: 'src/user.js',
			template: 'public/user.html',
			filename: 'user.html'
		}
	},
	configureWebpack: {
		output: {
			library: `${name}-[name]`,
			libraryTarget: 'umd',
			jsonpFunction: `webpackJsonp_${name}`,
			
		}
	},
	devServer: {
		inline: false, // 关闭热更新
		headers: {
			'Access-Control-Allow-Origin': '*'
		}
	},
};